
const app = getApp()
Page({
  data: {
    userId: null,
    skillArr: ['唱','跳','RAP','篮球']
  },
  goBack: function(){
    wx.navigateBack({
      delta: 1 //返回的页面数，如果 delta 大于现有页面数，则返回到首页,
    });
  },
  onShow: function () {
    if (app.globalData.userId) {
      var that = this;
      this.setData({
        userId: app.globalData.userId
      })
      wx.request({
        url: 'https://www.xinhuo.site/api/skill/list',
        data: {
          userId: this.data.userId
        },
        method: 'POST',
        header: {
          'Content-Type': 'application/json'
        },
        success(res) {
          if (res.data.syscode == 0) {
            that.data.skillArr = res.data.recordList[0].skillName.split(',');
            that.setData({
              skillArr: that.data.skillArr
            })
          }
        }
      })
    }
  },
  toEdit: function (e) {
    wx.navigateTo({
      url: '../skillEdit/skillEdit'
    })
  },
})
